home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 9
/
QRZ Ham Radio Callsign Database - Volume 9.iso
/
mac
/
unix
/
src
/
token.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-24
|
434b
|
33 lines
/*
** token.c
**
** tokenizes an input string, returning number of
** tokens found.
*/
#include "cb.h"
tokenize(str,list,llen)
char *str;
char *list[];
int llen;
{
int i;
int count = 0;
for (i=0;i<llen;i++)
list[i] = NULL;
if (!strlen(str))
return(0);
if ((list[count] = strtok(str, " ")) != NULL)
{
count++;
while ((count < llen) &&
((list[count] = strtok(NULL," ")) != NULL))
count++;
}
return(count);
}